package util;

import android.app.Activity;

/**
 * Created by ZQ on 2016/4/21.
 */
public class Globals {
    public static int SCREEN_WIDTH;
    public static int SCREEN_HEIGHT;

    //每行显示的字符总数
    public static int CHARCOUNT_LINE = 20;
//    字符之间的间隔
    public static int CHAR_AND_CHAR = 2;
    //行间距
    public static int LINE_AND_LINE = 2;
    //页边距
    public static int PAGE_AND_PAGE = 20;
    //字符大小
    public static int CHAR_SIZE;
    //行数
    public static int LINE_COUNT;

    //create a keyword to realize the function that the data provided by the SQLite can realize /r/n
    public static final String KEYWORD = "NEXT_LINE";

    //创建数据库连接
    public static MySqlite db;
    public static void init(Activity a) {
        db = new MySqlite(a);
        SCREEN_WIDTH = a.getWindowManager().getDefaultDisplay().getWidth();
        SCREEN_HEIGHT = a.getWindowManager().getDefaultDisplay().getHeight();

        CHAR_SIZE = (SCREEN_WIDTH-PAGE_AND_PAGE*2-(CHARCOUNT_LINE-1)*CHAR_AND_CHAR)/CHARCOUNT_LINE;
        LINE_COUNT = SCREEN_HEIGHT/6/(CHAR_SIZE+LINE_AND_LINE);

    }
}
